﻿using NUnit.Framework;
using System.Collections.Generic;

namespace IntellectShop.Tests
{
	[TestFixture]
	public class ScheduleTests
	{
		[SetUp]
		protected void SetUp()
		{
		}

		[TestCase(new int[] {}, "")]
		[TestCase(new int[] {1, 2, 3, 4, 5 }, "1-5")]
		[TestCase(new int[] { 1, 2, 3, 4, 5, 7, 8 }, "1-5, 7-8")]
		[TestCase(new int[] { 1, 2, 3, 4, 50 }, "1-4, 50")]
		[TestCase(new int[] { 2, 50, 51, 52, 53, 54 }, "2, 50-54")]
		[TestCase(new int[] { 178698 }, "178698")]
		[TestCase(new int[] { 1, 5 }, "1, 5")]
		[TestCase(new int[] { 1, 2, 3, 4, 5, 45, 46, 47, 67, 68, 69 }, "1-5, 45-47, 67-69")]
		public void TestNumericDiapazones(IEnumerable<int> list, string expected)
		{
			Assert.AreEqual(Common.Schedule.GetNumericDiapazones(list), expected);
		}
	}
}
